<div class="form ">


    <?php
    $form = $this->beginWidget('ext.AweCrud.components.AweActiveForm', array(
        'type' => 'horizontal',
        'id' => 'reporte-form',
        'enableAjaxValidation' => true,
        'clientOptions' => array('validateOnSubmit' => true, 'validateOnChange' => false,),
        'enableClientValidation' => false,
        'htmlOptions' => array('class' => 'narrow'),
    ));
    ?>


    <h4><i class="icon-phone"></i> REPORTE COMPLETO VENTAS
    </h4>
    <div class="widget-body">
        <?php echo $form->errorSummary($model) ?>

        <div class="row-fluid controles">
            
            <div class="span6">
            <?php // echo $form->dropDownListRow($model, 'evento', array('' => ' -- Seleccione -- ') + CHtml::listData(Evento::model()->de_carrera($carrera_id)->findAll(), 'id', Evento::representingColumn())) ?>
                
                <?php // $eventosLista= CHtml::listData(Evento::model()->de_carrera($carrera_id)->findAll(), 'id', Evento::representingColumn()); ?>
                    
            <div class="control-label required ">Filtro <span class="required">*</span></div>
            <?php
            $this->widget('bootstrap.widgets.TbDateRangePicker', array(
                'model' => $model,
                'attribute' => 'fechas',
                'options' => array(
                    'format' => 'dd/MM/yyyy',
                    'ranges' => array(
                        'Hoy' => array('today', 'today'),
                        'Ayer' => array('yesterday', 'yesterday'),
                        'Semana actual' => array('monday', 'today'),
                        'Semana Anterior' => array(Util::calcularSemanaAnterior(0), Util::calcularSemanaAnterior(1)),
                        'Mes Actual' => array(Util::obtenerPrimerDiaMes(), Util::obtenerUltimoDiaMes()),
                        'Mes Anterior' => array(Util::calcularMesAnterior(0), Util::calcularMesAnterior(1)),
                    )
                ),
                'htmlOptions' => array(
                    'readonly' => true,
                    'class'=>'hasDatepicker'
                ),
            ));
            ?>

            </div>
            <div class="span6">
 
            <?php
            $this->widget('bootstrap.widgets.TbButton', array(
                'buttonType' => 'submit',
                'type' => 'primary',
                'label' => Yii::t('AweCrud.app', 'Generar Reporte'),
                'htmlOptions' => array(
                    'style' => 'display:inline-block'
                )
            ));
            ?>
            </div>

           



        </div>


        <?php if ($visualizarReporte): ?> 

            <?php
            ?> 
            <div class="row-fluid">


                <!--                <div class="row-fluid span6" id="reportepie">
    <?php
//                    $this->Widget('ext.highcharts.HighchartsWidget', array(
//                        'scripts' => array(
//                            'modules/exporting', // adds Exporting button/menu to chart
//                        ),
//                        'options' => $piereport
//                    ));
    ?>
                                </div>-->
            </div>


            <div class="row-fluid" id="reportebarras">

    <?php
    $this->Widget('ext.highcharts.HighchartsWidget', array(
        'scripts' => array(
            'modules/exporting', // adds Exporting button/menu to chart
        ),
        'options' => $columnreport
    ));
    ?>

            </div>
<?php elseif (!$visualizarReporte && !empty($model->fechas)): ?>

            <div class="span12"></div>
            <div class="row-fluid"></div>
            <div class="alert alert-block alert-info fade in">
                <center>
                    <h4 class="alert-heading">Alerta!</h4>
                    <p>
                        No existen datos entre las fechas indicadas
                    </p>
                </center>
            </div>


<?php endif; ?>
    </div>
</div>

<?php $this->endWidget(); ?>


